<h2 class="dialog_title"><span>Rekap Perbuatan</span></h2>
<div class="dialog_content" style="padding: 10px 20px; width:700px">
<table>
	<tr>
		<td align="right">Periode : </td>
		<td><strong><?php echo date("m-Y",$periode2)?></strong></td>
	</tr>
</table>
<table class="marginT5 list" width="100%" border="0" cellpadding="5" cellspacing="0">
  <tr class="header">
    <th align="left"><span class="colorWhite">Tanggal Laporan</span></th>
    <th align="left"><span class="colorWhite">Tanggal Perbuatan</span></th>
    <th align="left"><span class="colorWhite">Nama Pelapor</span></th>
    <th align="left"><span class="colorWhite">Bidang</span></th>
    <th align="left"><span class="colorWhite">Jenis</span></th>
    <th align="left"><span class="colorWhite">Tingkat</span></th>
    <th align="left"><span class="colorWhite">Kategori</span></th>
    <th align="right"><span class="colorWhite">Point</span></th>
  </tr>
<?php 
	/*
	 * 1. load point perbuatan untuk 1 periode sebelumnya 
	 */
	$rank = @rank_select(false, 
		"a.KODE_KARYAWAN='$karyID' 
		AND MONTH(a.RANK_PERIODE)=" .(date("m", $periode2)-1). " AND YEAR(a.RANK_PERIODE)=" .date("Y", $periode2));
	$rank = mysql_fetch_assoc($rank);
?>  
  <tr <?php echo tag_zebra($z++)?>>
  	<td align="left" colspan=7">Point Periode <?php echo date("m-Y", $periode2-(60*60*24*30))?></td>
    <td align="right"><?php echo $totalPoint = $rank['RANK_POINT']? $rank['RANK_POINT'] : 0 ?></td>
  </tr>
<?php ?>
<?php 
	/*
	 * 2. daftar perbuatan untuk periode ini
	 */
	$data = perb_select_corelate2(false, 
		"a.KODE_KARYAWAN='$karyID' AND 
			DATE_FORMAT(a.PERB_TGL, '%Y-%m') = DATE_FORMAT('$periode', '%Y-%m')", 
		"a.PERB_TGL");
	
	while ($row = mysql_fetch_assoc($data)):
?>
  </tableBody>
  <tr <?php echo tag_zebra($z++)?>>
    <td><?php echo date("d-m-Y",strtotime($row['PERB_TGL'])) ." ". date("H:i:s",strtotime($row['PERB_WAKTU']))?></td>
    <td><?php echo date("d-m-Y",strtotime($row['DEPERB_TGL'])) ." ". date("H:i:s",strtotime($row['DEPERB_WAKTU']))?></td>
    <td><?php echo $row['LAPOR_NAMA']?></td>
    <td><?php echo $row['ACHIEV_BIDANG']?></td>
    <td><?php echo $row['ACHIEV_JENIS']?></td>
    <td><?php echo $row['DETACHIEV_TINGKAT']?></td>
    <td><?php echo $row['DETACHIEV_NAMA']?></td>
    <td align="right"><?php echo $row['PERB_POINT']?></td>
  </tr>
<?php $totalPoint += $row['PERB_POINT']?>
<?php endwhile;?>
  <tr class="header">
  	<th align="right" colspan=7"><span class="colorWhite">Total Point : </span></th>
    <th align="right"><span class="colorWhite"><?php echo $totalPoint?></span></th>
  </tr>
</table>
</div>
<div class="dialog_buttons"><input type="button" value="Close" name="close" onclick="FBModal_hide()" /></div>